package com.base.cn.platform.os.service.manage.op.affiche;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 消息管理接口
 * @author zsw
 * @create 2018-05-12
 */
@FeignClient(name = BaseService.appName , configuration = FeignAuthConfig.class)
public interface OpAfficheService extends BaseService {

    /**
     * 查询消息列表
     * @param currentPage 分页
     * @param affiche 查询条件
     * @create 2018-05-12
     */
    @RequestMapping(contextPath + "/op/queryAjaxAfficheList")
    Map<String,Object> queryAjaxAfficheList(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                            @RequestBody Map<String, Object> affiche,
                                            @RequestParam("subjectData") boolean subjectData,
                                            @RequestParam("courseData") boolean courseData,
                                            @RequestParam("sysUserData") boolean sysUserData);

    /**
     * 发布消息
     * @param affiche
     * @create 2018-05-12
     */
    @RequestMapping(contextPath + "/op/saveUpdateAffiche")
    Map<String ,Object> saveUpdateAffiche(@RequestBody Map<String, Object> affiche);

    /**
     * 删除消息
     * @param afficheIds 消息Id串
     * @create 2018-05-12
     */
    @RequestMapping(contextPath + "/op/deleteAffiche")
    Map<String,Object> deleteAffiche(@RequestParam("afficheIds") String afficheIds);

    /**
     * 根据ID查询消息
     * @param id 消息id
     * @create 2018-05-12
     */
    @RequestMapping(contextPath + "/op/findAfficheById")
    Map<String, Object> findAfficheById(@RequestParam("id") BigDecimal id,
                                        @RequestParam("subjectData") boolean subjectData,
                                        @RequestParam("courseData") boolean courseData,
                                        @RequestParam("sysUserData") boolean sysUserData);

    /**
     * 修改消息状态
     * @param afficheIds 消息id串
     * @param status 状态：0.正常 1.禁用 2.删除
     * @return
     */
    @RequestMapping(contextPath + "/op/updateAfficheStatusByIds")
    Map<String, Object> updateAfficheStatusByIds(@RequestParam("afficheIds") String afficheIds,
                                                 @RequestParam("status") Integer status);

    /**
     * 批量系统发布消息
     * Map<String,String> 中 userId，context，msgType
     * @param json
     */
    @RequestMapping(contextPath + "/op/sendAfficheToUser")
    Map<String,Object> sendAfficheToUser(@RequestParam("json") String json);

}
